
<?php $action = $this->getAction()->getId(); ?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'items-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($item); ?>

	<div class="span-7 append-1 ta_right bold"><?php echo $form->labelEx($item,'code'); ?></div>
	<div class="span-26 append-bottom-1">
		<?php echo $form->textField($item,'code'); ?>
		<?php echo $form->error($item,'code'); ?>
	</div>
	
	<div class="span-7 append-1 ta_right bold"><?php echo $form->labelEx($item,'short_description'); ?></div>
	<div class="span-26 append-bottom-1">
		<?php echo $form->textField($item,'short_description',array('size'=>30,'maxlength'=>30)); ?>
		<?php echo $form->error($item,'short_description'); ?>
	</div>
	
	<div class="span-7 append-1 ta_right bold"><?php echo $form->labelEx($item,'long_description'); ?></div>
	<div class="span-26 append-bottom-1">
		<?php echo $form->textArea($item,'long_description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($item,'long_description'); ?>
	</div>
	
	<?php $itemCategoryArray = CHtml::listData(ItemCategory::model()->findAll(),'id','category'); ?>
	
	<div class="span-7 append-1 ta_right bold"><?php echo $form->labelEx($item,'category_id'); ?></div>
	<div class="span-26 append-bottom-1">
		<?php echo $form->DropDownList($item,'category_id',$itemCategoryArray); ?> <a href="">Create New Category</a>
		<?php echo $form->error($item,'category_id'); ?>
	</div>
	
	<?php $itemTypeArray = CHtml::listData(ItemType::model()->findAll(),'id','type'); ?>
	
	<div class="span-7 append-1 ta_right bold"><?php echo $form->labelEx($item,'type_id'); ?></div>
	<div class="span-26 append-bottom-1">
		<?php echo $form->DropDownList($item,'type_id',$itemTypeArray); ?> <a href="">Create New Type</a>
		<?php echo $form->error($item,'type_id'); ?>
	</div>
	
	
	<div class="span-7 append-1 ta_right bold"><?php echo $form->labelEx($inventoryBatch,'quantity'); ?></div>
	<div class="span-26 append-bottom-1">
		<?php echo $form->textField($inventoryBatch,'quantity',array('size'=>10,'maxlength'=>30)); ?>
		<?php echo $form->error($inventoryBatch,'quantity'); ?>
	</div>
	
	<div class="span-7 append-1 ta_right bold"><?php echo $form->labelEx($inventoryBatch,'unit_cost'); ?></div>
	<div class="span-26 append-bottom-1">
		<?php echo $form->textField($inventoryBatch,'unit_cost',array('size'=>10,'maxlength'=>30)); ?>
		<?php echo $form->error($inventoryBatch,'unit_cost'); ?>
	</div>
	
		<div class="span-7 append-1 ta_right bold">
		<?php echo $form->labelEx($inventoryBatch,'location_id'); ?>
	</div>
	<?php 
	$locationArray = CHtml::listData(InventoryLocation::model()->findAll(),'id','code'); 
	$locationArray[0] = '[Select Location]';
	ksort($locationArray);
	?>

	<div class="span-26 append-bottom-1">
		<?php echo $form->DropDownList($inventoryBatch,'location_id',$locationArray, array('style'=>'width:139px;')); ?>
		<?php echo $form->error($inventoryBatch,'location_id'); ?>
	</div>

	
	<div class="edit-end"></div>

	<div style="text-align:center;">
		<?php echo CHtml::imageButton(Yii::app()->request->baseUrl ."/images/buttons/save.gif"); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->